﻿<%@ Page Language="C#" Theme="WebMaster" MasterPageFile="~/WebMaster/MasterPage.master" AutoEventWireup="true" CodeFile="NewsLetter.aspx.cs" Inherits="webapp4U.UI.WebMaster_Default" %>
<%@ Register Src="~/WebMaster/Controls/Title.ascx" TagName="Title" TagPrefix="uc" %>
<%@ Import Namespace="webapp4U" %>
<%@ Register TagPrefix="webapp4U" Namespace="webapp4U.UI" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PageContent" Runat="Server">

<uc:Title runat="server" ResourceKey='NewsLetter_Manager'  />
<br />


<table align="center" cellpadding="0" cellspacing="0">
<tr class="Hidden">
    <td align="center"><asp:Label runat="server" ID="lblMsg" Font-Bold="true" CssClass="lblMsg"></asp:Label></td>
</tr>
<tr>
    <td align="center" style="text-transform:uppercase">
        <b><%=ResourceManager.GetString("NewsLette_NewsletterList")%></b>
    </td>
</tr>

<tr>
    <td style="padding-top:15px;">
        <a class="linkAdd" href="<%=Globals.ApplicationPath %>WebMaster/Tools/NewsLetterAdd.aspx"><%=ResourceManager.GetString("NewsLetter_Add")%></a>
        &nbsp; | &nbsp;
        <a class="linkAdd" href="<%=Globals.ApplicationPath %>WebMaster/Tools/SendNewsLetter.aspx"><%=ResourceManager.GetString("NewsLetter_SendNewsletter")%></a>
   </td>
</tr>

<tr>
    <td align="center">
        <br />
        <asp:UpdatePanel ID="UpdatePanelContactPersons" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
        <asp:GridView runat="server"
                ID="GridViewItem" 
                Width="700" 
                DataSourceID="ObjectDataSource"
                AutoGenerateColumns="false" 
                DataKeyNames="NewsLetterID" 
                AllowPaging="True" 
                AllowSorting="True" 
                PagerSettings-Mode="NumericFirstLast"
                PageSize="25">
                <Columns>
                     <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20px" HeaderStyle-Width="20px" HeaderText="Delete">
                        <HeaderTemplate>
                            <input id="chkAll" onclick="javascript:SelectAllCheckboxes(this);" runat="server" type="checkbox" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox runat="server" ID="chkSelect" ToolTip='<%# Eval("NewsLetterID") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="Email" 
                  
                    HeaderStyle-HorizontalAlign="left"
                    ItemStyle-HorizontalAlign ="left">
                        <ItemTemplate><%# Eval("Email")%></ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="First Name" 
                        ItemStyle-Width="100"
                        HeaderStyle-Width="100"
                        HeaderStyle-HorizontalAlign="left"
                        ItemStyle-HorizontalAlign ="left">
                        <HeaderTemplate><%=ResourceManager.GetString("FirstName") %></HeaderTemplate>
                        <ItemTemplate><%# Eval("FirstName")%></ItemTemplate>
                    </asp:TemplateField>
                    
                     <asp:TemplateField HeaderText="Last Name" 
                        ItemStyle-Width="100"
                        HeaderStyle-Width="100"
                        HeaderStyle-HorizontalAlign="left"
                        ItemStyle-HorizontalAlign ="left">
                        <HeaderTemplate><%=ResourceManager.GetString("LastName") %></HeaderTemplate>
                        <ItemTemplate><%# Eval("LastName")%></ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="80" HeaderStyle-Width="80" HeaderText="Date">
                        <HeaderTemplate><%=ResourceManager.GetString("Date") %></HeaderTemplate>
                        <ItemTemplate><%# Formatter.FormatDate((DateTime)Eval("AddedDate"))%></ItemTemplate>
                    </asp:TemplateField>
                    
                </Columns>
                                        
                <EmptyDataTemplate>
                    <table align="center" width="300" border="0" bordercolorlight="#0099cc"  bordercolor="#0099cc">
                        <tr>
                            <td height="50" align="center">
                                <div align="center" id="EmptyData"><%=ResourceManager.GetString("DataEmpty") %></div>
                            </td>   
                        </tr>
                    </table>
                </EmptyDataTemplate>
            </asp:GridView>    
            
           <table align="center" border="0" cellpadding="0" cellspacing="0" width="700">
             <tr>
                <td align="right" width="100%">
                    <br />
                        <asp:LinkButton runat="server" ID="btDelete" Text="Delete" OnClick="btDelete_Click" />
                    <br /><br />
                </td>
             </tr>
           </table>
        </ContentTemplate>
       </asp:UpdatePanel>
    </td>
</tr>
</table>

<asp:ObjectDataSource
    ID="ObjectDataSource"
    runat="server"
    SelectMethod="GetAllNewsLetter"
    TypeName="webapp4U.BOL.NewsLetter">
</asp:ObjectDataSource>        



</asp:Content>

